The present invention relates to a memory controller for a flash memory system, a flash memory system and a method for writing data to a flash memory device, and particularly, to such a memory controller and a flash memory system that can write data to a flash memory device accurately and a method for writing data to a flash memory device accurately.
In recent years, flash memory devices, particularly NAND type flash memory devices, are widely used as semiconductor memory devices for memory cards, silicon disks and the like. In such a NAND type flash memory device, although a transition from an erased state (logical value=xe2x80x9c1xe2x80x9d) to a programmed state (logical value=xe2x80x9c0xe2x80x9d) can be performed for each memory cell as an individual unit, a transition from the programmed state (0) to the erased state (1) cannot be performed for each memory cell as an individual unit. Such a transition from the programmed state (0) to the erased state (1) can be only performed for a predetermined number of memory cells as a unit, called a xe2x80x9cblockxe2x80x9d, constituted of a plurality of memory cells. Such an operation is called xe2x80x9cblock erasingxe2x80x9d.
According to the NAND type flash memory device, because the transition from the programmed state (0) to the erased state (1) cannot be performed for each memory cell as an individual unit, in order to write data into a certain block, it is required to perform a block erasing operation to change the states of all memory cells included in the block to the erased state (1). A block-erased block becomes a free block in which no data are stored. In order to write new data into a flash memory device, search is made for such a free block and the new data are written into a found free block.
Because the flash memory device is a type of non-volatile memory device, the states of the memory cells of the flash memory device are maintained for a very long time regardless of whether power voltage is applied. Therefore, the data stored in the memory cells and the state of a free block of the flash memory device are reliably maintained after power voltage is cut off.
However, when reading or writing is performed with respect to a certain memory cell, gradual change may occur in the state of other memory cells connected to the same bit line as the certain memory cell owing to the xe2x80x9cdisturb phenomenonxe2x80x9d. It is known that incidence of the disturb phenomenon increases when the reading or writing operation is repeated. If the state of a memory cell is changed by the disturb phenomenon, not only are stored data corrupted but writing operation is also not successfully performed.
FIGS. 1(a) to 1(d) are schematic diagrams for explaining how writing operation is not successfully performed owing to the disturb phenomenon.
FIG. 1(a) shows the logical values of each of the memory cells constituting a page n right after block erasing. The page n is constituted of 8 memory cells and can store 256 (28) bits of data. As shown in FIG. 1(a), all memory cells constituting the page n are in erased state (logical value of xe2x80x9c1xe2x80x9d) right after block erasing. In the case where the logical values of all memory cells constituting the page n are xe2x80x9c1xe2x80x9d, data stored in the page n is FFh.
FIG. 1(b) shows the logical values of each of the memory cell constituting the page n in the case where the states of two memory cells thereof were changed from the erased state (1) to the programmed state (0) owing to the disturb phenomenon. Because the states of two memory cells have spontaneously changed to the programmed state (0), the data stored in the page n is changed to DDh as shown in FIG. 1(b).
FIG. 1(c) shows logical values of data (AAh) to be written in page n and the logical values of each of the memory cells constituting page n. To write the data (AAh) to page n, such an operation is performed that change the states of the memory cells corresponding to the bits whose logical value is xe2x80x9c0xe2x80x9d in the write data (AAh) from the erased state to the programmed state. No operation is performed on the memory cells corresponding to the bits whose logical value is xe2x80x9c1xe2x80x9d in the write data (AAh). Note that the data stored in page n was changed form FFh to DDh owing to the disturb phenomenon before writing of the data (AAh) thereto.
FIG. 1(d) shows the logical values of each of the memory cell constituting page n after the data (AAh) have been written. Because the writing operation is performed such that, on the one hand, the states of the memory cells corresponding to the bits whose logical value is xe2x80x9c0xe2x80x9d in the write data (AAh) are changed from the erased state to the programmed state and, on the other hand, the states of the memory cells corresponding to the bits whose logical value is xe2x80x9c1xe2x80x9d in the write data (AAh) are not changed, as mentioned above, the states of the two memory cells whose states were changed by the disturb phenomenon are maintained in the programmed state. As a result, the data stored in page n is not AAh but 88h. That is, incorrect data is stored.
As is apparent from the foregoing, the writing operation is not successfully performed if the states of the memory cells are changed owing to the disturb phenomenon.
If the power voltage is suddenly cut off during block erasing, it is possible that the memory cells in the block may not be sufficiently erased. Although this is not caused by the disturb phenomenon, in this case too, the writing operation is not successfully performed for the same reason as explained above.
It is therefore an object of the present invention to provide a memory controller which can write data correctly to flash memory devices.
Another object of the present invention is to provide a flash memory system which employs a memory controller which can write data correctly to flash memory devices.
A further object of the present invention is to provide a method for writing data correctly to flash memory devices.
The above and other objects of the present invention can be accomplished by a memory controller for accessing a flash memory device, comprising: search means for finding an erased block in said flash memory device in response to a data writing request from a host computer, verify means for verifying a state of said erased block found by said search means, and store means for storing data into said erased block which has been verified by said verify means.
According to this aspect of the present invention, improper data cannot be stored so that the quality of the data writing can be improved because verification of the state of the erased block in which data are to be stored is performed prior to data writing thereto.
In a preferred aspect of the present invention, the verify means verifies whether or not all flash memory cells constituting the erased block found by the search means are in an erased state.
In a further preferred aspect of the present invention, the memory controller further comprises test means, responsive to detection by said verify means of flash memory cell in a different state from said erased state, for testing whether or not said erased block is a defective block with a permanent error.
According to this preferred aspect of the present invention, in the case where a flash memory cell whose state is different from the erased state is detected, it is judged whether the block should be excluded. Therefore, exclusion of a defective block having a transient error can be avoided.
In a further preferred aspect of the present invention, the test means performs writing and first reading operations to store and read first test data to/from all flash memory cells constituting said erased block.
In a further preferred aspect of the present invention, the test means further performs erasing and second reading operations to store and read second test data to/from all flash memory cells constituting said erased block.
The above and other objects of the present invention can be also accomplished by a flash memory system, comprising: at least one flash memory chip divided into a plurality of blocks each of which includes a plurality of flash memory cells and a controller for controlling the flash memory chip, said controller including search means for finding from among said plurality of blocks an erased block in which all flash memory cells are in an erased state, store means for storing data into said erased block found by said search means, and verify means for verifying a state of said erased block found by said search means before said data are stored by said store means.
According to this aspect of the present invention, verification of the states of the erased block in which data are to be stored is performed prior to data writing thereto. Therefore, since improper data cannot be stored, the quality of data writing is improved.
In a preferred aspect of the present invention, the verify means verifies whether or not all flash memory cells constituting said erased block found by said search means are in an erased state.
In a further preferred aspect of the present invention, the flash memory chip and said controller are enclosed in the same package.
In a further preferred aspect of the present invention, the package is card-shaped.
In a further preferred aspect of the present invention, the controller further comprises test means, responsive to said verify means finding said erased block to be a defective block, for performing a test operation to test whether or not said defective block includes a permanent error.
In a further preferred aspect of the present invention, the test means inhibits use of said defective block in response to said defective block being found to include a permanent error.
In a further preferred aspect of the present invention, the flash memory system employs a plurality of flash memory chips, and said store means can store data into an erased block belonging to one flash memory chip while said test means performs said test operation on a defective block belonging to another flash memory chip.
The above and other objects of the present invention can be also accomplished by a method for storing data into a flash memory device divided into a plurality of blocks, comprising the steps of: searching said plurality of blocks to find a block in which to store said data, verifying a state of said block found in said searching step, and storing said data into said block verified by said verifying step.
According to this aspect of the present invention, verification of the states of the erased block in which data are to be stored is performed prior to data writing thereto. Therefore, since improper data cannot be stored, the quality of the data writing is improved.
In a preferred aspect of the present invention, the method further comprises a step of testing, in response to said verifying step finding said block found by said searching step to be unsuitable for storing said data, whether or not said block is a defective block with a permanent error.
According to this preferred aspect of the present invention, in the case where the verifying step finds the block found by the searching step to be unsuitable for storing said data, it is judged whether the block should be excluded. Therefore, exclusion of a defective block having a transient error can be avoided.
In a further preferred aspect of the present invention, the searching step searches another block for storing said data among said plurality of blocks responsive to said verifying step finding said block found by said searching step to be unsuitable for storing said data for finding.
In a further preferred aspect of the present invention, the data are stored into said another block regardless of whether or not said block is found to be a defective block with a permanent error in said testing step.
In another preferred aspect of the present invention, the data are stored into said block if said block is not found to be a defective block with a permanent error in said testing step.
In a further preferred aspect of the present invention, the testing step includes writing and first reading sub-steps for storing and reading first test data to/from all flash memory cells constituting said block.
In a further preferred aspect of the present invention, the said testing step further includes erasing and second reading sub-steps for storing and reading second test data to/from all flash memory cells constituting said erased block.
In a further preferred aspect of the present invention, storage of data in said block is inhibited if said block is found to be a defective block with a permanent error in said testing step.
The above and other objects and features of the present invention will become apparent from the following description made with reference to the accompanying drawings.